package cn.yangliu.ueditor.utils;

import cn.yangliu.ueditor.UEditorProperties;

import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

/**
 * 作者 杨柳
 * 创建时间 2017-09-04 02:12
 */
public class UEUtils {

    public static  Map<Object,Object> getConfigProperties(UEditorProperties properties){
        Map<Object,Object> config = new HashMap<>();
        try{
            Field[] fields = properties.getClass().getDeclaredFields();
            for (Field field : fields) {
                config.put(field.getName(),properties.getValue(field));
            }
        }catch (Exception e){
            throw new RuntimeException(e.getMessage(),e);
        }
        return config;
    }
}
